clear all

set more off
set scheme modern

if c(username)=="" { //insert username
cd "" // insert root path
}

if c(username)=="jmc4qg" {
cd "/Users/jmc4qg/The Lab Dropbox/Jonathan Colmer/Intergenerational_Presentation/Submissions/JPE - Micro/Figure_Replication/"
}

** Fig B3a **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3a.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

replace estimate = estimate*100
replace stderror = stderror*100

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("P.P. Change in the Likelihood of" "Any Parent-Child Link", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-3(1)3, labsize(large)) yline(0))
graph export "Figures/FigB3a.pdf", replace

** Fig B3b **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3b.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in the Number of" "Parent-Child Links", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-0.6(0.2)0.6, labsize(large)) yline(0))
graph export "Figures/FigB3b.pdf", replace

** Fig B3c **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3c.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

replace estimate = estimate*100
replace stderror = stderror*100

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("P.P. Change in the Likelihood of" "Being in the Main Analysis Sample", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-3(1)3, format(%9.0gc) labsize(large)) yline(0))
graph export "Figures/FigB3c.pdf", replace

** Fig B3d **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3d.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Parent Age" "at the Time of First Link", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-0.6(0.2)0.6, format(%9.0gc) labsize(large)) yline(0))
graph export "Figures/FigB3d.pdf", replace

** Fig B3e **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3e.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

replace estimate = estimate*100
replace stderror = stderror*100

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("P.P. Change in the Likelihood of" "Being Married", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-3(1)3, format(%9.0gc) labsize(large)) yline(0))
graph export "Figures/FigB3e.pdf", replace


** Fig B3f **

import delimited "Data/FigB3.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB3f.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

replace estimate = estimate*100
replace stderror = stderror*100

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("P.P. Change in the Likelihood of" "Being Divorced", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-3(1)3, format(%9.0gc) labsize(large)) yline(0))
graph export "Figures/FigB3f.pdf", replace


